<template>
    <view class="component-widgets-loadmore">
        <view v-if="hasMore" class="text" @click="loadmore">
            <text>加载更多</text>
        </view>
        <view v-else class="text">
            <text>我已经到底了~</text>
        </view>
    </view>
</template>

<script>
export default {
    name: "component-widgets-loadmore",
    data() {
        return {
            page: 1,
        };
    },
    props: {
        hasMore: {
            type: Boolean,
            default: true,
        },
        initPage: {
            type: Number,
            default: 1,
        },
    },
    components: {},
    created() {
        this.page = this.initPage;
    },
    mounted() {},
    destroyed() {},
    methods: {
        loadmore() {
            this.$emit("loadmore", this.page);
        },
    },
};
</script>

<style lang="less" scoped>
.component-widgets-loadmore {
    width: 100%;
    text-align: center;
    .text {
        font-size: 22rpx;
        font-weight: bold;
        color: #a0a0a0;
    }
}
</style>